const Mock=require('mockjs')
const fs=require('fs')
const path=require('path')

function getJsonFile(filepath){
	var json=fs.readFileSync(path.join(__dirname,filepath),'utf-8')
	console.log(json)
	var StrJson=JSON.parse(json)
	return StrJson;
}
//nodejs读取文件信息


module.exports=function(app){
	app.get('/user/userinfo',function(rep,res){
		var json=getJsonFile('./MockJson.json')
		res.json(Mock.mock(json));
	})
}